using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("CountryTournaments")]
	[Serializable]
    public class CountryTournament : DBO<CountryTournament>
    {
		#region Fields
		
		private int? _IdCountryTournament;
		private string _Name;
		private string _Icon;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public CountryTournament()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdCountryTournament 
		/// </summary>
		/// <param name="IdCountryTournament">The IdCountryTournament</param>
		public CountryTournament(int? IdCountryTournament )
		{
			this.IdCountryTournament = IdCountryTournament;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdCountryTournament">Sets int? value for IdCountryTournament</param>
		/// <param name="Name">Sets string value for Name</param>
		/// <param name="Icon">Sets string value for Icon</param>
		public CountryTournament(int? idCountryTournament, string name, string icon)
		{
			this.IdCountryTournament = idCountryTournament;
			this.Name = name;
			this.Icon = icon;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdCountryTournament
		/// </summary>
		[ColumnAttribute("IdCountryTournament", SqlDbType.Int , 4 , true, true, false)]
		public int? IdCountryTournament
		{
			set
			{
				this._IdCountryTournament = value;
			}
			get
			{
				return this._IdCountryTournament;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Name
		/// </summary>
		[ColumnAttribute("Name", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Name
		{
			set
			{
				this._Name = value;
			}
			get
			{
				return this._Name;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Icon
		/// </summary>
		[ColumnAttribute("Icon", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Icon
		{
			set
			{
				this._Icon = value;
			}
			get
			{
				return this._Icon;
			}
		}
		
		
		/// <summary>
		/// Get a list Tournament of current CountryTournament object base on IdCountryTournament
		/// </summary>
		public List<Tournament> TournamentListForIdCountryTournament
		{
			get
			{
				if (this.IdCountryTournament == null)
					return null;
				Tournament condition = new Tournament();
				condition.IdCountryTournament = this.IdCountryTournament;
				return TournamentController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdCountryTournament]
            /// </summary>
            public string IdCountryTournament
            {
                get
                {
                    return "IdCountryTournament";
                }
            }
            /// <summary>
            /// Get the name of column [Name]
            /// </summary>
            public string Name
            {
                get
                {
                    return "Name";
                }
            }
            /// <summary>
            /// Get the name of column [Icon]
            /// </summary>
            public string Icon
            {
                get
                {
                    return "Icon";
                }
            }
        }
        #endregion
    }
}
